class BaseLayer;

class _Test_Sync_Obj : CCObject {
private:
    int data;
    bool mShouldSync;
    std::vector<BaseLayer *> m_subscrib_list;
    
public:
    _Test_Sync_Obj();
    
    void regist(BaseLayer* layer)
    {
        m_subscrib_list.push_back(layer);
    }
    
    void unregist(BaseLayer* layer)
    {
        std::vector<BaseLayer*>::iterator iter;
        for(iter = m_subscrib_list.begin(); iter != m_subscrib_list.end(); ++iter)
        {
            if((BaseLayer*)(*iter) == layer) {
                m_subscrib_list.erase(iter);
                break;
            }
        }
    }
    void updateUserData()
    {
        BaseLayer* layer = NULL;
        std::vector<BaseLayer*>::iterator iter;
        
        for(iter = m_subscrib_list.begin(); iter != m_subscrib_list.end(); ++iter)
        {
            layer = (BaseLayer*)(*iter);
            //layer->updateUserData();
        }
    }
    
    void responseByPost(CCNode* node, void* data);
    
    void test();
};
